Optimal. Leaf size=91 \[ -\frac {a^2 (i A+B)}{2 c^4 f (i+\tan (e+f x))^4}+\frac {a^2 (A-3 i B)}{3 c^4 f (i+\tan (e+f x))^3}+\frac {a^2 B}{2 c^4 f (i+\tan (e+f x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} \frac {a^2 (A-3 i B)}{3 c^4 f (\tan (e+f x)+i)^3}-\frac {a^2 (B+i A)}{2 c^4 f (\tan (e+f x)+i)^4}+\frac {a^2 B}{2 c^4 f (\tan (e+f x)+i)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (e+f x))^2 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^4} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(a+i a x) (A+B x)}{(c-i c x)^5} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {2 a (i A+B)}{c^5 (i+x)^5}-\frac {a (A-3 i B)}{c^5 (i+x)^4}-\frac {a B}{c^5 (i+x)^3}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a^2 (i A+B)}{2 c^4 f (i+\tan (e+f x))^4}+\frac {a^2 (A-3 i B)}{3 c^4 f (i+\tan (e+f x))^3}+\frac {a^2 B}{2 c^4 f (i+\tan (e+f x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.13, size = 91, normalized size = 1.00 \begin {gather*} \frac {a^2 (-8 i A+3 (-3 i A+B) \cos (2 (e+f x))-3 (A+3 i B) \sin (2 (e+f x))) (\cos (6 e+8 f x)+i \sin (6 e+8 f x))}{96 c^4 f (\cos (f x)+i \sin (f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.25, size = 68, normalized size = 0.75
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {2 i A +2 B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {3 i B -A}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}+\frac {B}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,c^{4}}\) | \(68\) |
default | \(\frac {a^{2} \left (-\frac {2 i A +2 B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {3 i B -A}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}+\frac {B}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}\right )}{f \,c^{4}}\) | \(68\) |
risch | \(-\frac {a^{2} {\mathrm e}^{8 i \left (f x +e \right )} B}{32 c^{4} f}-\frac {i a^{2} {\mathrm e}^{8 i \left (f x +e \right )} A}{32 c^{4} f}-\frac {i a^{2} A \,{\mathrm e}^{6 i \left (f x +e \right )}}{12 c^{4} f}+\frac {a^{2} {\mathrm e}^{4 i \left (f x +e \right )} B}{16 c^{4} f}-\frac {i a^{2} {\mathrm e}^{4 i \left (f x +e \right )} A}{16 c^{4} f}\) | \(110\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 5.13, size = 67, normalized size = 0.74 \begin {gather*} -\frac {3 \, {\left (i \, A + B\right )} a^{2} e^{\left (8 i \, f x + 8 i \, e\right )} + 8 i \, A a^{2} e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, {\left (i \, A - B\right )} a^{2} e^{\left (4 i \, f x + 4 i \, e\right )}}{96 \, c^{4} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 218 vs. \(2 (73) = 146\).
time = 0.37, size = 218, normalized size = 2.40 \begin {gather*} \begin {cases} \frac {- 512 i A a^{2} c^{8} f^{2} e^{6 i e} e^{6 i f x} + \left (- 384 i A a^{2} c^{8} f^{2} e^{4 i e} + 384 B a^{2} c^{8} f^{2} e^{4 i e}\right ) e^{4 i f x} + \left (- 192 i A a^{2} c^{8} f^{2} e^{8 i e} - 192 B a^{2} c^{8} f^{2} e^{8 i e}\right ) e^{8 i f x}}{6144 c^{12} f^{3}} & \text {for}\: c^{12} f^{3} \neq 0 \\\frac {x \left (A a^{2} e^{8 i e} + 2 A a^{2} e^{6 i e} + A a^{2} e^{4 i e} - i B a^{2} e^{8 i e} + i B a^{2} e^{4 i e}\right )}{4 c^{4}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 201 vs. \(2 (78) = 156\).
time = 1.02, size = 201, normalized size = 2.21 \begin {gather*} -\frac {2 \, {\left (3 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 6 i \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 3 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 17 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 16 i \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 6 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 17 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 6 i \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 3 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 3 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{3 \, c^{4} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{8}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.71, size = 78, normalized size = 0.86 \begin {gather*} \frac {a^2\,\left (3\,B\,{\mathrm {tan}\left (e+f\,x\right )}^2+2\,A\,\mathrm {tan}\left (e+f\,x\right )-A\,1{}\mathrm {i}\right )}{6\,c^4\,f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4+{\mathrm {tan}\left (e+f\,x\right )}^3\,4{}\mathrm {i}-6\,{\mathrm {tan}\left (e+f\,x\right )}^2-\mathrm {tan}\left (e+f\,x\right )\,4{}\mathrm {i}+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________